package lihao2;

public class Test3 {
    public static void main(String[] args) {
        String s="abcdcba";

        StringBuilder sb=new StringBuilder(s);

        String afterReverse=sb.reverse().toString();

        int isequal=afterReverse.compareTo(s);

        if (isequal==0){
            System.out.println("是回文");
        }else
            System.out.println("不是回文");
        }
}
